package com.jx.lcs.product.entity;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

import com.fasterxml.jackson.annotation.JsonIgnore;

/**
 */
@Entity
@Table(name = "tc_product_type")
public class ProductType implements java.io.Serializable {

	// Fields

	private static final long serialVersionUID = 1L;
	private String id;
	private String typecode;
	private String typename;
	private String useable;
	private int ordernum;
	@JsonIgnore
	private Set<ProductInfo> products = new HashSet<ProductInfo>(0);

	// Constructors

	/** default constructor */
	public ProductType() {
	}

	/** full constructor */
	public ProductType(String typename, String name, String typecode,String useable,int ordernum, Set<ProductInfo> products) {
		this.typename = typename;
		this.typecode = typecode;
		this.useable = useable;
		this.ordernum = ordernum;
	}

	// Property accessors
	@Id
//	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "ID", unique = true, nullable = false)
	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@Column(name = "TYPECODE")
	public String getTypecode() {
		return typecode;
	}

	public void setTypecode(String typecode) {
		this.typecode = typecode;
	}

	@Column(name = "TYPENAME")
	public String getTypename() {
		return typename;
	}

	public void setTypename(String typename) {
		this.typename = typename;
	}

	@Column(name = "USEABLE")
	public String getUseable() {
		return useable;
	}

	public void setUseable(String useable) {
		this.useable = useable;
	}

	@Column(name = "ORDERNUM")
	public int getOrdernum() {
		return ordernum;
	}

	public void setOrdernum(int ordernum) {
		this.ordernum = ordernum;
	}

//	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "ProductType")
//	public Set<Product> getProducts() {
//		return this.products;
//	}
//
//	public void setProducts(Set<Product> products) {
//		this.products = products;
//	}

}